package com.example.oop.person;

import com.example.oop.skill.Skill;
import com.example.oop.skill.StudyLevel;

import java.util.HashSet;
import java.util.Set;

public class Student extends Person{
    private String matriculationNumber;
    private int semester;
    private Set<String> knowledge;
    //黑色实体箭头代表合成，引用到了其他类
    private StudyLevel studyLevel;
    private Set<Skill> skills;

    public String getMatriculationNumber(){
        return matriculationNumber;
    }
    public int getSemester(){
        return semester;
    }

    public Set<String> getKnowledge() {
        return knowledge;
    }

    public void acquireKnowledge(String learnKnowledge){
        //把学习到的课程加入到已学习的课程中
        knowledge.add(learnKnowledge);
    }

    public StudyLevel getStudyLevel() {
        return studyLevel;
    }

    public Set<Skill> getSkills() {
        return skills;
    }

    public Student(String name, int age, String tumId, String matriculationNumber, StudyLevel studylevel, int semester){
        super(name,age,tumId);
        this.matriculationNumber = matriculationNumber;
        this.semester = semester;
        this.studyLevel = studylevel;
        //make sure to
        //initialize the sets.
        //java的集合初始化，容器
        knowledge = new HashSet<>();
        skills = new HashSet<>();

    }
    public void learnSkill(Skill skill){
       skills.add(skill);
    }

    @Override
    public void say(String text) {
        super.say(text);
    }
}
